// main global script file

// called when the game starts, before the first room is loaded
function game_start() 
{
}

// put anything you want to happen every game cycle in here
function repeatedly_execute() 
{
}

// put here anything you want to happen every game cycle, even when the game is blocked
function repeatedly_execute_always() 
{
}

// called when a key is pressed. keycode holds the key's ASCII code
function on_key_press(eKeyCode keycode) 
{
  if (IsGamePaused()) keycode = 0; // game paused, so don't react to keypresses
  
  if (keycode == eKeyCtrlQ) QuitGame(1); // Ctrl-Q
  if (keycode == eKeyF9) RestartGame(); // F9
  if (keycode == eKeyF12) SaveScreenShot("scrnshot.pcx");  // F12
  if (keycode == eKeyCtrlS) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode == eKeyCtrlV) Debug(1,0); // Ctrl-V, version
  if (keycode == eKeyCtrlA) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode == eKeyCtrlX) Debug(3,0); // Ctrl-X, teleport to room
}

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
  {
  }
  else if (button == eMouseLeft) 
  {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
  else // right-click, so cycle cursor
  {   
    mouse.SelectNextMode();
  }
}

